 <meta charset="utf-8">
 <div class="box" id="biz_metting_conatainer">
            <div class="box-header with-border">
               <form id="searchForm" role="form" class="form-inline">
                    <div class="form-group">
                         <label>会议名称</label>
                         <input name="title" v-model="searchForm.title" id="title"  type="text" placeholder="" class="form-control">
                    </div>
                     <div class="form-group">
                    <label>审核状态</label>
                          <select class="form-control"  v-model="searchForm.status"  name="status" >
                        		  <option value="">请选择</option>
                                  <option value="1">报名中</option>
                                  <option value="2">报名结束</option>
                                  <option value="3">会议进行中</option>
                                  <option value="4">会议结束</option>
                           </select>
                    </div>
                     <button type="button"  class="btn btn-info pull-right m-t-n-xs" v-on:click="search;"><strong>查询</strong></button>
                </form>
            </div>
 <div class="box-body">
 	<div class="row">
 	  <div class="col-md-12">
 	                           <div class="btn-group " id="mettingBootstrapTableToolbar" role="group">
                                    
                                    <button type="button"  class="btn btn-default" v-on:click="startMeeting">
                                        <i class="glyphicon glyphicon-ok" aria-hidden="true"></i>开始会议
                                    </button>
                                    <button type="button" class="btn btn-default" v-on:click="endMeeting">
                                        <i class="glyphicon glyphicon-remove" aria-hidden="true"></i> 结束会议
                                    </button>
                                    
                                    <button type="button" class="btn btn-default" v-on:click="addMeeting">
                                        <i class="glyphicon glyphicon-plus" aria-hidden="true"></i> 创建会议
                                    </button>
                                    
                                     <button type="button" class="btn btn-default" v-on:click="addC">
                                        <i class="glyphicon glyphicon-plus" aria-hidden="true"></i> 创建会议2
                                    </button>
                                    
                           </div>
                                
           <table id="mettingBootstrapTable" data-mobile-responsive="true" ></table>
 	  </div>
 	</div>
 </div>
 </div>

<script> 

new Vue({  
	  el: '#biz_metting_conatainer',  
	  data:{
		  searchForm:{
			  title: "asdad",
			  status: null
		  },
		  bus:new Vue(),
	  },
	  mounted:function(){
		  
		 var _this=this;
		 this.initTable();
	  },
  methods: {
	  addC: function (){
		  
		  newC("metting.add.html","会议添加")
	  }
	  initTable:function(){
		  let columns=[
				{checkbox:true},
				{field:'title',title:'会议名称',width:160},
				{field:'metStartTime',title:'会议开始时间',width:160},
				{field:'metEndTime',title:'会议结束时间',width:160},
				{field:'signupStartTime',title:'报名开始时间',width:160},
				{field:'signupEndTime',title:'报名结束时间',width:160},
				//{field:'linkPhone',title:'会议联系电话',width:160},
				//{field:'linkPerson',title:'报名联系人',width:160},
				{field:'status',title:'会议状态',width:100,formatter:this.formatStatus}
				];
		  let url="metting/ma/metMetting/loadMetMettingDataSet";
  		zfesBstable.laodTable($("#mettingBootstrapTable"),$("#searchForm"),$("#mettingBootstrapTableToolbar"),url,columns,this.searchForm);
	  },
	  search:function(){
		  zfesBstable.reload($("#mettingBootstrapTable")); 
	  },
	  refresh:function(){
		  zfesBstable.refresh($("#mettingBootstrapTable"));
	  },
	  addMeeting: function(){
		  let　_this=this;
		 var url="/views/metting/met/metting.add.html";
		 zfesLayerEditDg.open(url,{},"会议信息编辑",460,function(){_this.refresh();});
		 
	  },
	  startMeeting : function(){
		  if(zfesBstable.isSelectedRow($("#mettingBootstrapTable"))){
			  var ids=zfesBstable.getRowIds($("#mettingBootstrapTable"));
			  var　_this=this;
				 alertSwal.confirm("开启会议","是否执行该操作",function(){
						    let ajaxUrl = "metting/ma/metMetting/setMettingOnOff";
						    zfesAjax.ajaxTodo(ajaxUrl, { "ids" : ids,"status":3}, function(data) {
								alertSwal.successText(data.message);
								_this.refresh();
							});
						});
		  }
	  },
	
	  endMeeting: function(){
		  if(zfesBstable.isSelectedRow($("#mettingBootstrapTable"))){
			  var ids=zfesBstable.getRowIds($("#mettingBootstrapTable"));
			  var　_this=this;
				 alertSwal.confirm("结束会议","是否执行该操作",function(){
						    let ajaxUrl = "metting/ma/metMetting/setMettingOnOff";
						    zfesAjax.ajaxTodo(ajaxUrl, {"ids" : ids,"status":4}, function(data) {
								alertSwal.successText(data.message);
								_this.refresh();
						});
		  		});
		  }
	  },

	  //状态_D#1报名中，2报名结束，3会议进行中，4会议结束，5取消-1移除 #
	  formatStatus:function(value,row,index){
		  //#1报名成功，2已缴费，3审核通过，4审核不通过，-1移除 #
			if("1"==value||1==value){
				return '<span class="label label-warning">报名中</span>';
			}else if("2"==value||2==value){
				return '<span class="label label-success">报名结束</span>';
			}else if("3"==value||3==value){
				return '<span class="label label-success">会议进行中</span>';
			}else if("4"==value||4==value){
				return '<span class="label label-danger">会议结束</span>';
			}else{
				return value;
			}
			
		},
 	
 }

});
</script>


